//
//  FilterComputerPlaysMisere.h
//  PrefCore
//
//  Created by Sergey on 6/5/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PSHand.h"
#import "PSEvaluator.h"

PSHandHash PSFilterComputerPlaysMisere(
    PSHandHash candidates
,   PSTrickHash trick);

PSHandHash PSFilterDeclarerFirstHandMove(
    PSHandHash candidates
,   PSCardSuit trump
,   PSPlayerId declarer
,   PSHandHash* hands);

PSHandHash PSFilterDeclarerFirstHandMoveOpen(
    PSHandHash candidates
,   PSCardSuit trump
,   PSPlayerId declarer
,   PSHandHash* hands);

PSHandHash PSFilterHumanPlaysMisere(
    PSEvaluator* evaluator
,   PSHandHash candidates
,   PSPlayerId player
,   PSTrickHash trick
,   uint32_t round
,   uint8_t handIndex
,   PSHandHash* hands);

PSHandHash PSFilterPlayerNonFirstHandMove(
    PSHandHash candidates
,   PSPlayerId player
,   PSTrickHash trick
,   PSCardSuit trump
,   uint8_t handIndex);

PSHandHash PSFilterSameSuitConsecutiveCardsMin(
    PSHandHash hand
,   PSHandHash trash);

PSHandHash PSFilterSameSuitConsecutiveCardsMax(
    PSHandHash hand
,   PSHandHash trash);

PSHandHash PSFilterMissingSuits(
    PSHandHash candidates
,   PSHandHash* hands
,   PSPlayerId player);

PSHandHash PSFilterSecondPlusKingTrick(
    PSHandHash candidates
,   PSPlayerId player
,   PSHandHash playerCards
,   PSPlayerId declarer
,   PSHandHash declarerCards);

PSHandHash PSFilterThirdQueenTrick(
    PSHandHash candidates
,   PSHandHash declarerCards);

PSHandHash PSFilterWhisterAfterDeclarerMove(
    PSEvaluator* evaluator
,   PSHandHash candidates
,   PSPlayerId player
,   PSTrickHash trick
,   PSCardSuit trump
,   uint8_t handIndex
,   PSPlayerId declarer);

PSHandHash PSFilterWhisterAfterDeclarerMoveOpen(
    PSEvaluator* evaluator
,   PSHandHash candidates
,   PSHandHash* hands
,   PSPlayerId player
,   PSTrickHash trick
,   PSCardSuit trump
,   uint32_t round
,   uint8_t handIndex
,   PSPlayerId declarer);

PSHandHash PSFilterWhisterFirstHandMove(
    PSHandHash candidates
,   PSHandHash playerCards
,   PSHandHash declarerCards);
